package com.iti.jets.gpts.home;

// default package
// Generated Mar 22, 2014 9:41:00 PM by Hibernate Tools 3.4.0.CR1

import com.iti.jets.gpts.dao.AbstractDAO;
import com.iti.jets.gpts.pojo.TranServiceType;
import java.util.List;
import java.util.Set;
import javax.naming.InitialContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Criteria;
import org.hibernate.LockMode;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Example;
import org.hibernate.criterion.Restrictions;

/**
 * Home object for domain model class TranServiceType.
 * @see .TranServiceType
 * @author Hibernate Tools
 */
public class TranServiceTypeHome extends AbstractDAO<TranServiceType>{

    public TranServiceTypeHome(SessionFactory sessionFactory) {
        super(sessionFactory);
    }
        public Set searchByServiceType(String name) {

        Criteria criteria = session.createCriteria(TranServiceType.class, "t")
                .add(Restrictions.eq("t.name", name));
        TranServiceType t= (TranServiceType) criteria.list().get(0);
        return  t.getTranServices();

      /*  List result = new ArrayList(tst.getTranServices());
        if (result.isEmpty()) {
            return null;
        } else {
            return result;
        }*/
        }
}
